#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
const int mod=998244353;
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

	int n;
	cin >> n;
	char ch[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
	string s;
	if(n==0)
	{
		cout << "00";
	}
	if(n>0)
	{
		while(n!=0)
	{
		int temp=n%16;
		s.push_back(ch[temp]);
		n=n/16;
	}
	if(s.size()==1)
	{
		cout << "0" << s;
	}
	else if(s.size()==2)
	{
		for(int i=s.size()-1;i>=0;i--)
		{
			cout << s[i];
		}
	}
	}
	
    return 0;
}

